﻿using System;
using System.Reflection;
using System.Collections.Generic;
using System.Windows.Forms;
using MediaPortal.GUI.Library;
using MediaPortal.Plugins.Trailers.Providers;

namespace MediaPortal.Plugins.Trailers
{
  public class TrailersPlugin : ISetupForm, IShowPlugin
  {
    
    #region Variables

    // Private Variables

    private const int windowId = 5900;

    // Protected Variables
    // Public Variables
    #endregion  

    #region Interface implementations

    #region ISetupForm Members

    // Returns the name of the plugin which is shown in the plugin menu
    public string PluginName()
    {
      return "My Trailers";
    }

    // Returns the description of the plugin is shown in the plugin menu
    public string Description()
    {
      return "Browse trailers and movie clips.";
    }

    // Returns the author of the plugin which is shown in the plugin menu
    public string Author()
    {
      return "Armand Pondman (armandp)";
    }

    // Init
    public static bool Initialize()
    {
      Version ver = Assembly.GetExecutingAssembly().GetName().Version;
      Log.Info("My Trailers (" + ver.Major + "." + ver.Minor + "." + ver.Build + "." + ver.Revision + ")");
      return true;
    }

    // show the setup dialog
    public void ShowPlugin()
    {
      //TrailersConfig form = new TrailersConfig();
      //form.ShowDialog();
    }

    // Indicates whether plugin can be enabled/disabled
    public bool CanEnable()
    {
      return true;
    }

    // Get Windows-ID
    public int GetWindowId()
    {
      // WindowID of windowplugin belonging to this setup
      // enter your own unique code
      return windowId;
    }

    // Indicates if plugin is enabled by default;
    public bool DefaultEnabled()
    {
      return true;
    }

    // indicates if a plugin has it's own setup screen
    public bool HasSetup()
    {
      return false;
    }

    /// <summary>
    /// If the plugin should have it's own button on the main menu of MediaPortal then it
    /// should return true to this method, otherwise if it should not be on home
    /// it should return false
    /// </summary>
    /// <param name="strButtonText">text the button should have</param>
    /// <param name="strButtonImage">image for the button, or empty for default</param>
    /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
    /// <param name="strPictureImage">subpicture for the button or empty for none</param>
    /// <returns>true : plugin needs it's own button on home
    /// false : plugin does not need it's own button on home</returns>

    public bool GetHome(out string strButtonText, out string strButtonImage,
      out string strButtonImageFocus, out string strPictureImage)
    {
      strButtonText = GUILocalizeStrings.Get(5900);
      strButtonImage = string.Empty;
      strButtonImageFocus = string.Empty;
      strPictureImage = "hover_my trailers.png";
      return true;
    }

    #endregion

    #region IShowPlugin Members

    public bool ShowDefaultHome()
    {
      return true;
    }

    #endregion

    #endregion

  }
}
